package com.xblibo.xruth.entity;

import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import com.xblibo.xruth.common.BaseEntity;

/**   
 * @Title: module.java
 * @Package xb.core.mode.role
 * @Description: TODO(项目模块，基础表，用于权限控制)
 * @author libo  
 * @date Dec 28, 2010 12:35:59 PM
 * @version V1.0   
 */
@Entity
@Table(name="module")
public class Module extends BaseEntity {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	/**
	 * 模块名称
	 */
	@Column(name="name",length=25)
	private String name;
	
	/**
	 * 模块名称英文
	 */
	@Column(name="short_name",length=25)
	private String shortName;
	
	/**
	 * 模块所包含的功能
	 */
	/* FetchType.LAZY表示懒加载。对于xxxtoMany时即获得多的一方fetch的默认值是FetchType.LAZY懒加载。对于xxxtoOne时即获得一的一方fetch的默认值是FetchType.EAGER立即加载   
	 * mappedBy="module"就相当于inverse=true,(mappedBy指定的是不需要维护关系的一端)   
	 */
	@OneToMany(mappedBy="module",cascade=CascadeType.ALL,fetch=FetchType.LAZY) 
	private Set<Function> functions;
	
	/**
	 * 是否是默认的,0为false,1为ture
	 */
	@Column(name="is_defual")
	private Boolean isDefual;

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Set<Function> getFunctions() {
		return functions;
	}

	public void setFunctions(Set<Function> functions) {
		this.functions = functions;
	}

	public Boolean getIsDefual() {
		return isDefual;
	}

	public void setIsDefual(Boolean isDefual) {
		this.isDefual = isDefual;
	}

	public String getShortName() {
		return shortName;
	}

	public void setShortName(String shortName) {
		this.shortName = shortName;
	}
	
}
